using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._StandardFeatureAnalysisTools._ManageData
{
    /// <summary>
    /// <para>Merge Layers</para>
    /// <para>Copies all features from two layers into a new layer. The layers to be combined must contain the same feature types (points, lines, or polygons). You can control how the fields from the input layers are joined and copied.</para>
    /// <para>将两个图层中的所有要素复制到一个新图层中。要合并的图层必须包含相同的要素类型（点、线或面）。您可以控制输入图层中的字段的连接和复制方式。</para>
    /// </summary>    
    [DisplayName("Merge Layers")]
    public class MergeLayers : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public MergeLayers()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_inputLayer">
        /// <para>Input Layer</para>
        /// <para>The point, line, or polygon features to merge with the merge layer.</para>
        /// <para>要与合并图层合并的点、线或面要素。</para>
        /// </param>
        /// <param name="_mergeLayer">
        /// <para>Merge Layer</para>
        /// <para>The point, line, or polygon features to merge with the input layer. The merge layer must contain the same feature type (point, line, or polygon) as the input layer.</para>
        /// <para>要与输入图层合并的点、线或面要素。合并图层必须包含与输入图层相同的要素类型（点、线或面）。</para>
        /// </param>
        /// <param name="_outputName">
        /// <para>Output Name</para>
        /// <para>The name of the output layer to create on your portal.</para>
        /// <para>要在门户上创建的输出图层的名称。</para>
        /// </param>
        public MergeLayers(object _inputLayer, object _mergeLayer, object _outputName)
        {
            this._inputLayer = _inputLayer;
            this._mergeLayer = _mergeLayer;
            this._outputName = _outputName;
        }
        public override string ToolboxName => "Standard Feature Analysis Tools";

        public override string ToolName => "Merge Layers";

        public override string CallName => "sfa.MergeLayers";

        public override List<string> AcceptEnvironments => ["extent"];

        public override object[] ParameterInfo => [_inputLayer, _mergeLayer, _outputName, _mergingAttributes, _output];

        /// <summary>
        /// <para>Input Layer</para>
        /// <para>The point, line, or polygon features to merge with the merge layer.</para>
        /// <para>要与合并图层合并的点、线或面要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _inputLayer { get; set; }


        /// <summary>
        /// <para>Merge Layer</para>
        /// <para>The point, line, or polygon features to merge with the input layer. The merge layer must contain the same feature type (point, line, or polygon) as the input layer.</para>
        /// <para>要与输入图层合并的点、线或面要素。合并图层必须包含与输入图层相同的要素类型（点、线或面）。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Merge Layer")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _mergeLayer { get; set; }


        /// <summary>
        /// <para>Output Name</para>
        /// <para>The name of the output layer to create on your portal.</para>
        /// <para>要在门户上创建的输出图层的名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Name")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _outputName { get; set; }


        /// <summary>
        /// <para>Merging Attributes</para>
        /// <para><xdoc>
        ///   <para>A list of values that describe how fields from the merge layer are to be modified and matched with fields in the input layer. By default, all fields from both inputs will be carried across to the output layer.</para>
        ///   <para>If a field exists in one layer but not the other, the output layer will contain both fields. The output field will contain null values for the input features that did not have the field. For example, if the input layer contains a field named TYPE but the merge layer does not contain TYPE, the output will contain TYPE, but its values will be null for all the features copied from the merge layer.</para>
        ///   <para>You can control the following merge actions (how fields on the merge layer are written to the output).
        ///   <bulletList>
        ///     <bullet_item>REMOVE—The merge layer field will be removed from the output layer.  </bullet_item><para/>
        ///     <bullet_item>RENAME—The merge layer field will be renamed in the output. You cannot rename a field from the merge layer to a field from the input layer. If you want to make field names equivalent, use the match option.  </bullet_item><para/>
        ///     <bullet_item>MATCH—The merge layer field is renamed and matched to a field from the input layer. For example, the input layer has a field named CODE and the merge layer has a field named STATUS. You can match STATUS to CODE, and the output will contain the CODE field with values of the STATUS field used for features copied from the merge layer. Type casting is supported (for example, double to integer, integer to string), except for string to numeric.  </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>描述如何修改合并图层中的字段并将其与输入图层中的字段匹配的值列表。默认情况下，两个输入中的所有字段都将传递到输出层。</para>
        ///   <para>如果一个字段存在于一个图层中，而另一个图层中不存在，则输出图层将包含两个字段。输出字段将包含没有该字段的输入要素的空值。例如，如果输入图层包含名为 TYPE 的字段，但合并图层不包含 TYPE，则输出将包含 TYPE，但对于从合并图层复制的所有要素，其值将为空。</para>
        /// <para>您可以控制以下合并操作（如何将合并图层上的字段写入输出）。
        ///   <bulletList>
        ///     <bullet_item>移除—将从输出图层中移除合并图层字段。</bullet_item><para/>
        ///     <bullet_item>RENAME—合并图层字段将在输出中重命名。您无法将合并图层中的字段重命名为输入图层中的字段。如果要使字段名称等效，请使用 match 选项。 </bullet_item><para/>
        ///     <bullet_item>MATCH - 合并图层字段将被重命名并匹配到输入图层中的字段。例如，输入图层有一个名为 CODE 的字段，合并图层有一个名为 STATUS 的字段。您可以将 STATUS 与 CODE 匹配，输出将包含 CODE 字段，其中包含用于从合并图层复制的要素的 STATUS 字段的值。支持类型转换（例如，双精度转换为整数，整数转换为字符串），但字符串转换为数字除外。 </bullet_item><para/>
        ///   </bulletList>
        ///   </para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Merging Attributes")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _mergingAttributes { get; set; } = null;


        /// <summary>
        /// <para>Output</para>
        /// <para></para>
        /// <para></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output")]
        [Description("")]
        [Option(OptionTypeEnum.derived)]
        public object _output { get; set; }


        public MergeLayers SetEnv(object extent = null)
        {
            base.SetEnv(extent: extent);
            return this;
        }

    }

}